Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.1 #3

Open
wants to merge 164 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
b5ce93a
initial accessory & bridge implementations.
Feb 5, 2020
fbfbd1d
more accessory & bridge work.
Feb 5, 2020
9f9c2a9
initial characteristics work.
Feb 5, 2020
47b7d0a
implemented initial characteristics.
Feb 5, 2020
109543a
seperated homekit logic to new project.
Feb 5, 2020
4135980
added build project.
Feb 5, 2020
d5c5b99
fixed build file permissions.
Feb 5, 2020
7050e51
tiny fix for linux builds.
Feb 5, 2020
ea1582f
fixing github workflow builds.
Feb 5, 2020
def90f1
renamed project as homer
Feb 5, 2020
0c4efe4
Update README.md
bonesoul Feb 5, 2020
29c5e19
implemented ientity.
Feb 5, 2020
f6131c2
Create LICENSE
bonesoul Feb 6, 2020
51e76b4
Update README.md
bonesoul Feb 6, 2020
5c7ac4b
Update LICENSE
bonesoul Feb 6, 2020
2566325
Update LICENSE
bonesoul Feb 6, 2020
433f82b
Rename changelog.md to CHANGELOG.md
bonesoul Feb 6, 2020
90851cc
updated license texts.
Feb 6, 2020
ab436a4
updated license texts.
Feb 6, 2020
79d72b2
added optional characteristics to services.
Feb 6, 2020
d85f77f
more service implementation.
Feb 6, 2020
6c55d40
tiny improvement in Characteristic.cs
Feb 6, 2020
c27996d
Update README.md
bonesoul Feb 6, 2020
6484b11
Update README.md
bonesoul Feb 6, 2020
b0f769e
added homer gifs.
Feb 6, 2020
75d768c
tiny fix.
Feb 6, 2020
d31823c
Update README.md
bonesoul Feb 6, 2020
988bfb9
Update README.md
bonesoul Feb 6, 2020
0382c65
Update README.md
bonesoul Feb 6, 2020
a8c2b46
Update README.md
bonesoul Feb 6, 2020
b914218
Update README.md
bonesoul Feb 6, 2020
7a9237e
Update README.md
bonesoul Feb 6, 2020
96cffa3
Update README.md
bonesoul Feb 6, 2020
95985c8
Update README.md
bonesoul Feb 6, 2020
12a4b03
Update README.md
bonesoul Feb 6, 2020
f12a3ad
Update README.md
bonesoul Feb 6, 2020
e03009d
Update README.md
bonesoul Feb 6, 2020
fea98ca
Update README.md
bonesoul Feb 6, 2020
572445b
some tests.
Feb 6, 2020
c8a4929
Update dependency McMaster.Extensions.CommandLineUtils to v2.5.1
renovate-bot Feb 7, 2020
e8e3e45
Merge pull request #5 from bonesoul/renovate/mcmaster.extensions.comm…
bonesoul Feb 7, 2020
480579a
more characteristic work.
Feb 7, 2020
c6c5530
remove unused files.
Feb 7, 2020
4dd96ab
added packages.
Feb 7, 2020
bac9131
implemented core internals.
Feb 7, 2020
dc6c6c4
fixed missing files.
Feb 7, 2020
96d191f
started working on bonjour server.
Feb 7, 2020
a010166
fixed namespaces.
Feb 7, 2020
414fa7c
trying bonjour support.
Feb 7, 2020
90a4e21
tiny fix.
Feb 7, 2020
dbf56d4
another fix.
Feb 7, 2020
4ff4b53
renamed project homer.server as homer.
Feb 7, 2020
b555e88
more work.
Feb 7, 2020
8bf2ee7
bridgesetupmanager work.
Feb 7, 2020
23e8971
Update README.md
bonesoul Feb 7, 2020
b5ea467
Update README.md
bonesoul Feb 7, 2020
2f41fcf
Update README.md
bonesoul Feb 7, 2020
115585c
added hkas metadata.
Feb 7, 2020
a1c50c9
updated import.js
Feb 9, 2020
bf0cfe5
updated import.js - cs files are now generated using nunjucks template.
Feb 9, 2020
55b95d6
tiny update for import.js.
Feb 9, 2020
7c13acc
added services support to import.js.
Feb 10, 2020
7e03b25
const fix in characteristic definitions.
Feb 10, 2020
31199eb
tiny change in characteristic.html
Feb 10, 2020
1909758
tiny bridgesetupmanager work.
Feb 10, 2020
a4ff1bb
fixed services.
Feb 10, 2020
24fd6b3
fixed optional characteristics in services.
Feb 10, 2020
bc2b3d3
initial mdns implementation.
Feb 10, 2020
2a69eb7
accessorybase now prints it's data.
Feb 10, 2020
7da3850
more LogAccessorySummary() work.
Feb 10, 2020
2890661
added homekit config support.
Feb 10, 2020
a20b192
added const uuids to characteristics and services.
Feb 10, 2020
044a7ee
Update dependency Microsoft.VisualStudio.Threading.Analyzers to v16.5…
renovate-bot Feb 10, 2020
c3e2936
Merge pull request #15 from bonesoul/renovate/microsoft.visualstudio.…
bonesoul Feb 10, 2020
fc3257e
started implementing a simple node version.
Feb 10, 2020
56a77dc
initial discovery done.
Feb 11, 2020
25b663b
initial api work.
Feb 11, 2020
ba201fd
added async/await support.
Feb 11, 2020
c3b957f
more plugin manager work.
Feb 11, 2020
42cb49d
plugin init work.
Feb 11, 2020
799ccf3
improved plugin subsystem.
Feb 11, 2020
bff2dbd
more plugin manager work.
Feb 11, 2020
691ec3a
tiny plugin & api version work.
Feb 11, 2020
e96db15
implemented accessory repository.
Feb 11, 2020
5bc05db
make accessory config compatible with homebridge.
Feb 11, 2020
64b4b38
accessory events / on, off tests.
Feb 11, 2020
174fb9b
first orchestration of plex & philips hue lights done!
Feb 11, 2020
fc94ca5
Update README.md
bonesoul Feb 12, 2020
c9105d5
tiny change.
Feb 12, 2020
a06c050
updated node-persist.
Feb 12, 2020
d0b2523
updated to winston3.
Feb 12, 2020
95a0325
added ms support to winston logs.
Feb 12, 2020
1065552
added labels to all log-lines.
Feb 12, 2020
089a57f
we have a single version file now.
Feb 12, 2020
d9535d8
loggers are configurable again.
Feb 12, 2020
1517991
implemented custom loggers.
Feb 12, 2020
0c37893
improved pluggin loggers.
Feb 12, 2020
17407fd
fixed plugin's splat logging.
Feb 12, 2020
b55a5c4
fix vscode internal terminal outputs.
Feb 12, 2020
f70e716
tiny change on confs.
Feb 12, 2020
73b3f5a
tiny change on default.yaml.
Feb 12, 2020
be2f715
moved custom config to local.yaml.
Feb 12, 2020
fef7255
moved node-prototype to contrib/node-prototype.
Feb 12, 2020
3306a8e
identifier cache work.
Feb 12, 2020
175123b
fixed typo.
Feb 12, 2020
771983c
removed unused bridgesetupmanager for now.
Feb 12, 2020
7a2620b
bridge & accessorybase clean-up.
Feb 12, 2020
0aa3395
moved dotnet-core project to dotnet-core/.
Feb 14, 2020
6a3c32f
fix dotnet-core folder name.
Feb 14, 2020
08a4c9d
fix github actions dotnet-core builds.
Feb 14, 2020
42a6c57
another fix for github builds.
Feb 14, 2020
b9d5ee4
fix github builds.
Feb 14, 2020
c80852d
another fix for github builds.
Feb 14, 2020
e533538
fixed dotnet-core project's builds.
Feb 14, 2020
034ee45
fix github builds.
Feb 14, 2020
e0cb10e
updated dotnetcore-sdk version.
Feb 14, 2020
b33f784
aonther github ci fix.
Feb 14, 2020
1ea652c
test gitversion.
Feb 14, 2020
4090f77
fix artifact names
Feb 14, 2020
37b3fac
another ci fix.
Feb 14, 2020
7a38c8d
tiny change on ci builds.
Feb 14, 2020
79cd25d
tiny fix on ci builds.
Feb 14, 2020
5afbe19
ci builds fix.
Feb 14, 2020
29acdec
ci improvements.
Feb 14, 2020
07bd5f5
ci fix.
Feb 14, 2020
1fabefa
test ci matrix.
Feb 14, 2020
1a5259d
ci test.
Feb 14, 2020
669581a
ubuntu-latest
Feb 14, 2020
b3ab5c5
test ci
Feb 14, 2020
fe87fd5
another ci test.
Feb 14, 2020
84d70c0
ci test
Feb 14, 2020
14d0922
test ci.
Feb 14, 2020
2bb71fd
test ci
Feb 14, 2020
e32303c
ci test
Feb 14, 2020
c622177
another test.
Feb 14, 2020
ac1a6c0
test ci
Feb 14, 2020
2257774
test ci
Feb 14, 2020
e3c9b69
test ci
Feb 14, 2020
67a1fe4
test ci
Feb 14, 2020
3227628
fixed ci
Feb 14, 2020
be98816
fix ci.
Feb 14, 2020
98afebf
test ci
Feb 14, 2020
da6f525
tiny fix.
Feb 14, 2020
91883d2
Update aspnet Extensions monorepo to v3.1.2
renovate-bot Feb 18, 2020
8979cd9
Merge pull request #29 from bonesoul/renovate/aspnet-extensions-monorepo
bonesoul Feb 18, 2020
79daa49
Update dependency Bullseye to v3.2.0
renovate-bot Feb 20, 2020
07a7f94
Merge pull request #30 from bonesoul/renovate/bullseye-3.x
bonesoul Feb 20, 2020
bbb79a2
Update dependency config to v3.2.6
renovate-bot Feb 21, 2020
8105682
Merge pull request #31 from bonesoul/renovate/config-3.x
bonesoul Feb 21, 2020
f425482
Update build.yml
bonesoul Feb 26, 2020
cd714ca
Update dependency config to v3.3.0
renovate-bot Feb 27, 2020
0e22096
Merge pull request #32 from bonesoul/renovate/config-3.x
bonesoul Feb 27, 2020
18e5c44
Update dependency GitVersionTask to v5.2.0
renovate-bot Mar 7, 2020
d690427
Merge pull request #33 from bonesoul/renovate/gitversiontask-5.x
bonesoul Mar 8, 2020
fdb9ef3
Update dependency McMaster.Extensions.CommandLineUtils to v2.6.0
renovate-bot Mar 8, 2020
f0af803
Merge pull request #34 from bonesoul/renovate/mcmaster.extensions.com…
bonesoul Mar 8, 2020
d5adc97
Update dependency hap-nodejs to v0.5.7
renovate-bot Mar 11, 2020
ba52db6
Merge pull request #35 from bonesoul/renovate/hap-nodejs-0.x
bonesoul Mar 11, 2020
c67b56e
Update dependency GitVersionTask to v5.2.4
renovate-bot Mar 17, 2020
53808c4
Merge pull request #37 from bonesoul/renovate/gitversiontask-5.x
bonesoul Mar 17, 2020
fd6f91c
Update aspnet Extensions monorepo to v3.1.3
renovate-bot Mar 24, 2020
839f9ec
Merge pull request #39 from bonesoul/renovate/aspnet-extensions-monorepo
bonesoul Mar 24, 2020
b4234e0
Bump lodash from 4.17.15 to 4.17.19 in /node.js
dependabot[bot] Jul 19, 2020
221234e
Merge pull request #40 from bonesoul/dependabot/npm_and_yarn/node.js/…
bonesoul Jul 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build
on: [push]
jobs:
dotnetcore:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
dotnetcore: ['3.1.101']
name: ${{ matrix.os }} - dotnet core ${{ matrix.dotnetcore }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: fetch all git history
run: git fetch --prune --unshallow
- name: install gitversion
uses: gittools/actions/gitversion/setup@v0.9
with:
versionSpec: '5.1.x'
- name: setup gitversion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v0.9
- name: setup dotnet core
uses: actions/setup-dotnet@v1.4.0
with:
dotnet-version: ${{ matrix.dotnetcore }}
- name: build info
run: |
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
- name: unix build
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
run: |
cd dotnet-core
./build.sh
- name: windows build
if: matrix.os == 'windows-latest'
run: |
cd dotnet-core
./build.cmd
- name: test
run: |
cd dotnet-core
dotnet test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
[Ll]og/

# Visual Studio 2015/2017 cache/options directory
.vs/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
40 changes: 40 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
“Commons Clause” License Condition v1.0

The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition.

Without limiting other conditions in the License, the grant of rights under the License will not include, and the License
does not grant to you, the right to Sell the Software.

For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you under the License to provide to third
parties, for a fee or other consideration (including without limitation fees for hosting or consulting/ support services related to the
Software), a product or service whose value derives, entirely or substantially, from the functionality of the Software. Any license
notice or attribution required by the License must also include this Commons Clause License Condition notice.

Software: Homer
License: MIT License
Licensor: Hüseyin Uslu

---

MIT License

Homer, Copyright (C) 2020, Hüseyin Uslu, shalafiraistlin at gmail dot com
https://github.com/bonesoul/homer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
128 changes: 127 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,127 @@
# smarty
<h1 align="center">homer</h1>

<div align="center">
<img src='https://github.com/bonesoul/homer/blob/develop/assets/images/homer/homer-lazy-1.gif?raw=true'/>
<br/><strong>The complete home automation for Homer Simpson.</strong>
</div>

<br />

<div align="center">
<a href='https://github.com/bonesoul/homer/actions'>
<img src='https://github.com/bonesoul/homer/workflows/build/badge.svg'/>
</a>
</div>

<div align="center">
<sub>Built with ❤︎ by <a href="https://github.com/bonesoul">Hüseyin Uslu</a>.</sub>
</div>

## what is homer?

homer is code-first home & office automation system allowing complex interactions between accessories.

## why?

as current so called "home automation" systems are actually just "home information" system, I needed a real "home automation" system where IoT stuff can interract which each other and respond to stuff happening at your home/office. Even more homer allows you to develop complex virtual orchestrators that can command stuff together.

The problem is that with current config-first solutions, it's hard to wire off which the main reason I decided to develop a solution with code-first (programmatic) aproach.

<div align="center">
<img src='https://github.com/bonesoul/homer/blob/develop/assets/images/homer/homer-lazy-3.gif?raw=true'/>
<br/><strong>homer, orchestrating the office.</strong>
</div>

## sample scenarios

### turn on/off lights based on plex's status

a very basic scenario that anyone can expect from an so-called home-automation system right? with homer it's just a piece of cake;

```

let orchestrate = async () => {
// get hue bridge.
let huePlatform = this._platformRepository.active['Hue.Hue'];

// wait for hue bridge to expose the bulbs.
let lights = await getLights(huePlatform);

// start listening for plex events.
this._accessoryRepository.active['Plex.Plex'].getService(Service.OccupancySensor).getCharacteristic(Characteristic.OccupancyDetected).on('change', (data) => {
for(const entry of lights) { // loop through all lights.
entry.lightService.getCharacteristic(Characteristic.On).setValue(!data.newValue); // if plex started streaming close them, otherwise re-open them.
}
});
}

let getLights = async (hue) => {
return new Promise((resolve, reject) => {
try {
let lights = [];
hue.accessories((accessories) => {
for(const entry of accessories) {
if (entry.constructor.name === 'HueAccessory' && entry.lightService) {
lights.push(entry);
}
}
return resolve(lights);
});
} catch (err) {
return reject(err);
}
});
}

await orchestrate(); // let the magic happen!
```

here you can see it happening; [youtube](https://www.youtube.com/watch?v=ig6Ax14W_Dg)

<img src='https://media.giphy.com/media/TgaeFyjosJ3GeLzyR5/giphy.gif'/>

## status

still in early development stage.

- initially working on homekit support.
- will soon be able to pair with homekit.

## voice control support?

initially will have support for apple homekit, have plans for alexa & goole asistant support too.

## platforms

homer can run on a wide range of platforms including x86, x64, ARM32 and ARM64 - including Raspberry Pi or variants. Check [dotnet core runtime](https://github.com/dotnet/runtime/blob/master/src/libraries/pkg/Microsoft.NETCore.Platforms/runtime.json) too see all available runtimes.

## operating systems

- Windows
- macOS
- Linux (Redhat, Fedora, Debian, Ubuntu, Mint, openSUSE, SLES, Alphine, Rasbian..)

## requirements

```
dotnet core 3.1
```

## building

```
git clone https://github.com/bonesoul/homer
Windows: .\build.cmd
Linux: ./build.sh
MacOS: ./build.sh
```

## tests

```
dotnet test
```

<div align="center">
<img src='https://github.com/bonesoul/homer/blob/develop/assets/images/homer/homer-lazy-2.gif?raw=true'/>
</div>
Binary file added assets/images/homer/homer-lazy-1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/homer/homer-lazy-2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/homer/homer-lazy-3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions contrib/importer-dotnetcore/characteristic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#region license
//
// homer - The complete home automation for Homer Simpson.
// Copyright (C) 2020, Hüseyin Uslu - shalafiraistlin at gmail dot com
// https://github.com/bonesoul/homer
//
// “Commons Clause” License Condition v1.0
//
// The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition.
//
// Without limiting other conditions in the License, the grant of rights under the License will not include, and the License
// does not grant to you, the right to Sell the Software.
//
// For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you under the License to provide
// to third parties, for a fee or other consideration (including without limitation fees for hosting or consulting/ support
// services related to the Software), a product or service whose value derives, entirely or substantially, from the functionality
// of the Software.Any license notice or attribution required by the License must also include this Commons Clause License
// Condition notice.
//
// License: MIT License
// Licensor: Hüseyin Uslu
#endregion

using System.Collections.Generic;

namespace Homer.Platform.HomeKit.Characteristics.Definitions
{
public class {{classyName}}Characteristic: Characteristic
{
public const string Uuid = "{{characteristic.UUID}}";

{% if characteristic.Constraints and characteristic.Constraints.ValidValues -%}
{% for key,value in characteristic.Constraints.ValidValues -%}
{%- set name = ucwords(value).replace(r/[^\w]+/g, '_') -%}
{% if r/^[1-9]/.test(name) -%}{%- set name = '_' + name -%}{%- endif %}
public const int {{ name }} = {{ key }};
{%- endfor %}
{%- endif %}

public {{classyName}}Characteristic(): base(
uuid: "{{characteristic.UUID}}",
displayName: "{{characteristic.Name}}",
format: CharacteristicFormat.{{getCharacteristicFormat(characteristic.Format)}},
{% if characteristic.Unit -%}unit: CharacteristicUnit.{{getCharacteristicUnit(characteristic.Unit)}},{%- endif %}
{% if gotMaximumValue(characteristic) -%}maxValue: {{characteristic.Constraints.MaximumValue}},{%- endif %}
{% if gotMinimumValue(characteristic) -%}minValue: {{characteristic.Constraints.MinimumValue}},{%- endif %}
{% if gotStepValue(characteristic) -%}minStep: {{characteristic.Constraints.StepValue}},{%- endif %}
{% if characteristic.Constraints and characteristic.Constraints.ValidValues -%}
validValues: new List<int> {
{%- for key,value in characteristic.Constraints.ValidValues -%}
{{ key }},
{%- endfor -%}
},
{%- endif %}
permissions: new List<CharacteristicPermission>
{
{% for value in characteristic.Properties %}
{%- set perm = getCharacteristicPermsKey(value) -%}
{% if perm %}CharacteristicPermission.{{perm}},{% endif %}
{% endfor %}
})
{
}
}
}
Binary file not shown.
18 changes: 18 additions & 0 deletions contrib/importer-dotnetcore/data/version.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildAliasOf</key>
<string>HomeKitAccessorySimulator</string>
<key>BuildVersion</key>
<string>1727</string>
<key>CFBundleShortVersionString</key>
<string>125</string>
<key>CFBundleVersion</key>
<string>125</string>
<key>ProjectName</key>
<string>HomeKitAccessorySimulator</string>
<key>SourceVersion</key>
<string>135003000000000</string>
</dict>
</plist>
Loading