Commit Graph

128 Commits

Author SHA1 Message Date
Cody Cutrer
344b653b85
[homekit] implement all AccessoryInformationService characteristics (#17031)
mostly as metadata static characteristics

fixes #9595

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2024-07-09 20:01:14 +02:00
lsiepel
71a208b91b
Apply Spotless after release (#17016)
* Spotless

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
2024-07-07 23:20:16 +02:00
openhab-bot
4b5e4646ac [unleash-maven-plugin] Preparation for next development cycle. 2024-07-07 18:09:31 +00:00
Wouter Born
a2868bb0dc
Use diamond operator and remove redundant type arguments (#16249)
Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-09 23:46:15 +01:00
Wouter Born
3415397a83
Remove unnecessary semicolons (#16214)
This helps with stopping the proliferation of unnecessary semicolons.

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-05 23:56:58 +01:00
Wouter Born
4fe00bb2bf
Remove redundant feature dependencies (#16204)
* Remove redundant feature dependencies

The following features are already dependencies of openhab-runtime-base:

* openhab-core-base
* openhab-core-model-item
* openhab-core-model-script
* openhab-transport-mdns

See also: https://github.com/openhab/openhab-addons/pull/16202#issuecomment-1876875456

* Remove redundant openhab.tp-jackson and openhab.tp-jaxb feature dependencies

Signed-off-by: Wouter Born <github@maindrain.net>
2024-01-05 20:00:24 +01:00
Jacob Laursen
f4596f581e
Update license headers to 2024 (#16168)
* Update copyright year in configuration
* Update license headers
* Manually update nibeheatpump headers (.cpp/.h/.ino)
* Manually update smsmodem header
* Manually update hueemulation header
* Manually update addon-header.xml header

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2024-01-01 18:14:57 +01:00
Wouter Born
c58d894bf0
Use OnOffType.from to reduce code (#16101)
You can create an `OnOffType` using a boolean nowadays which reduces the amount of code.

Signed-off-by: Wouter Born <github@maindrain.net>
2023-12-23 19:06:21 +01:00
Holger Friedrich
533cc666ab
Apply spotless after release (#16097)
* Apply spotless after release
* itests: resolve bundles

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-12-22 23:30:38 +01:00
openhab-bot
83e0485219 [unleash-maven-plugin] Preparation for next development cycle. 2023-12-22 14:37:48 +00:00
Holger Friedrich
f24a4305b8
Improve javadoc for some addons (#15701)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-10-08 00:25:04 +02:00
Holger Friedrich
cbf4411034
Improve javadoc for all addons (#15667)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-09-30 21:49:12 +02:00
Holger Friedrich
5b42c4b071
Java 17 features (#15493)
- add missing @override
- Java style array syntax
- remove redundant modifiers
- always move String constants to left side in comparisons
- simplify lambda expressions and return statements
- use replace instead of replaceAll w/o regex

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-08-26 08:52:11 +02:00
Holger Friedrich
56e7daf898
[io] Use Java 17 features (#15485)
* instanceof matching and multiline strings
* use Map/Set/List.of instead of Collections

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-08-24 06:44:56 +02:00
lsiepel
a1b79b6b7b
[homekit] Checkstyle cleanup (#15450)
* Remove package
* java 17 instanceofpattern
* EqualsAvoidNullCheck
* NoEmptyLineSeparatorCheck
* ConstantNameCheck

Signed-off-by: lsiepel <leosiepel@gmail.com>
2023-08-21 20:12:49 +02:00
Kai Kreuzer
72607d3bee Apply spotless
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2023-07-24 01:20:31 +02:00
openhab-bot
809fceaff3 [unleash-maven-plugin] Preparation for next development cycle. 2023-07-23 19:19:01 +00:00
Holger Friedrich
96d0293913
Declare missing connection attribute (#15016)
* Declare missing connection attribute
* change mactts, marytts, and picotts to none for consistency

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-05-23 21:38:13 +02:00
Holger Friedrich
8a9ac6eccc
Upgrade SAT to 0.14 (#14981)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-05-13 19:04:36 +02:00
openhab-bot
4f533710ff
New translations homekit.properties (German) (#14655) 2023-03-22 22:57:28 +01:00
Cody Cutrer
d9ceb63b82
[homekit] Unify all enum handling (#14036)
* [homekit] unify all enum handling

regardless of if it's a required or optional characteristic,
or even "boolean" enums

then allow number or switch items to be linked with enums

then update the docs listing the numeric value for enums

as part of this, global configuration of thermostat enum values
is no longer supported; you must use metadata.
in particular, for GarageDoorOpener, the global settings didn't
even actually work, so they should work now.

Fixes #13595

* [homekit] default-invert boolean items for garage door states

this was previously handled explicitly by the switch statement.
so need to set the inverted flag now that we're building a
mapping instead

* [homekit] document that CurrentDoorState can be linked to a Contact item
* [homekit] improve docs on invert param to createMapping

also fix a new helper method not properly passing through the inverted
param

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-03-22 13:58:12 +01:00
J-N-K
8e902f6324
Bump spotless to 2.35 and Eclipse Java Formatter to 4.26 (#14645)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-03-21 21:03:05 +01:00
openhab-bot
a3c621fffc
New Crowdin updates (#14541)
* New translations iCloud.properties (German)
* New translations miele.properties (German)
* New translations jruby.properties (German)
* New translations mqtt.properties (German)
* New translations influxdb.properties (German)
* New translations homekit.properties (German)
* New translations amazonechocontrol.properties (German)
* New translations amazonechocontrol.properties (German)
2023-03-05 20:25:51 +01:00
Jonas Bötsch
2ec097d529
[homekit] Update README.md (#14521)
Tilted blinds do not work when using the documented config. 
Changed it to a working example.
Refer here: https://community.openhab.org/t/homekit-addon-adjustable-blinds-not-working-anymore/144869
2023-03-03 15:12:44 +01:00
Cody Cutrer
0312e687ba
[homekit] fix restarted on network interface change (#14226)
a regression caused during the final changes of #13877

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-01-28 00:39:19 +01:00
J-N-K
5f8214f08a
Adapt to core changes (addon.xml) (#13289)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2023-01-15 20:31:42 +01:00
Cody Cutrer
0de87b15d2
[homekit] Implement IrrigationSystem Accessory (#14209)
* [homekit] Implement IrrigationSystem

Fairly trivial now, except that a ServiceLabelService has to be added
to the accessory.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-01-13 20:25:06 +01:00
Holger Friedrich
ee54882841
Fix SAT warnings (#14214)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-01-13 19:10:59 +01:00
Holger Friedrich
4e44de3894
Fix SAT warnings (#14202)
* Fix SAT warnings

- checkstyle.ModifierOrderCheck
- checkstyle.OneStatementPerLineCheck
- checkstyle.NeedBracesCheck
- PMD.UseStandardCharsets
- PMD.UseCollectionIsEmpty
- PMD.UnusedLocalVariable
- PMD.SimplifyBooleanReturns where reasonable, suppress where
readability is better without change
- PMD.SimplifyBooleanExpressions

* Include StandardCharsets

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-01-13 08:11:06 +01:00
Cody Cutrer
32909fa237
[homekit] Add support for TV accessory (#14055)
* [homekit] TV accessory

Now possible since we support multiple secondary services. Just need to explicitly
declare that InputSource is a linked service to a Television, not just a secondary
service.

Note also that since TV and related services have so many mandatary characteristics
that are often static, I introduced a new way to declare characteristics -
via metadata on the service's item. Honestly, I feel like it's a lot cleaner to
have a factory create the mandatory characteristics the same way as the optional
characteristics, and then construct the service ourselves instead of basing the
service on the specific accessory interface. But this commit is already big enough,
I didn't want to go refactoring _all_ of the accessories to do it that way just
yet. This is why I have "unused" metadata characteristic factory methods for
AirQuality, HeaterCooler, and Thermostat - I started to make those configurable
via metadata, then realized they were mandatory characteristics that couldn't
be found from metadata via the current infrastructure.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-01-12 15:29:50 +01:00
Holger Friedrich
0304d74f87
Fix Markdown warnings in README.md (#14187)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-01-09 17:51:12 +01:00
Cody Cutrer
7608c41484
[homekit] properly expose services from dummy accessories (#14169)
Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-01-06 16:25:42 +01:00
Jacob Laursen
4dd6d3a8a2
Update license headers to 2023 (#14154)
* Update copyright year in configuration
* Update license headers

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
2023-01-06 09:49:54 +01:00
Tim Harper
9c5ea29ae0
[homekit] Add additional troubleshooting steps for homekit (#14046)
* [homekit] Add additional troubleshooting steps for homekit

Signed-off-by: Tim Harper <timcharper@gmail.com>
2023-01-04 20:32:29 +01:00
Cody Cutrer
47f5489d70
[homekit] Improve multiple instance management (#14016)
* [homekit] improve instance management

 * allow addressing individual instances for most console commands
 * don't restart all instances if simply adding/removing instances on
   config change
 * clear stored info when removing instances

* [homekit] reset instance identity when clearing pairings
* [homekit] log the actual interface we looked up

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-01-03 23:10:42 +01:00
Cody Cutrer
e39e69144b
[homekit] support Rollershutter items for HoldPosition (#14045)
* [homekit] support Rollershutter items for HoldPosition

just send STOP to them

* [homekit] log a warning for incompatible HoldPosition items

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-12-27 11:55:12 +01:00
Cody Cutrer
b62e1455ff
[homekit] Allow configuring secondary services as members of a group (#13879)
* [homekit] allow configuring secondary services as members of a group

Required introduction of AccessoryGroup to represent the base
AccessoryInformationService for ease of configuring multiple of the
same service.

This is also "breaking" in that someone who previously had HomeKit
accessories nested directly inside of a group that was itself a
HomeKit accessory will now have those items grouped within the Home
app.

* [homekit] combine multiple readme sections on complex accessories

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-12-23 23:41:44 +01:00
Cody Cutrer
7c2d5dcca5
[homekit] implement List-Pairings method (#13982)
* [homekit] implement List-Pairings method
* [homekit] fix listUsers() method
* [homekit] bump HAP-java to 2.0.5

refs #13949

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-12-23 00:16:55 +01:00
Cody Cutrer
a079603aab
[homekit] allow configuring min/max light level (#14034)
since the default is weirdly 0.0001, yet my sensors can report a
straight 0.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-12-22 00:37:26 +01:00
Cody Cutrer
462dca8040
[homekit] update AuthInfo objects when blockUserDeletion changes (#14017)
* [homekit] update AuthInfo objects when blockUserDeletion changes

Signed-off-by: Cody Cutrer <cody@cutrer.us>

* [homekit] general cleanup of redundant method call and unused local vars

Signed-off-by: Cody Cutrer <cody@cutrer.us>

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-12-22 00:31:05 +01:00
J-N-K
4d6d6443ef
fix spotless after release (#14014)
Signed-off-by: Jan N. Klug <github@klug.nrw>
2022-12-19 15:22:17 +01:00
openhab-bot
7993786dc9 [unleash-maven-plugin] Preparation for next development cycle. 2022-12-19 00:55:11 +00:00
Kai Kreuzer
260f58904f
[homekit] Simplify start level handling (#13914)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2022-12-11 17:09:31 +01:00
Cody Cutrer
1dbcaf8f0c
[homekit] delay starting until a particular StartLevel (#13877)
* [homekit] delay starting until a particular StartLevel

instead of a blind "delay by seconds", the new default won't even
attempt to start until items are loaded (both file-based and UI-based),
with an additional config to let the user delay it any further (in
case they have items coming from JSR223 scripts that can't run until
at least SL20 anyway).

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-12-11 15:54:10 +01:00
Cody Cutrer
108c48dda5
[homekit] add BasicFan accessory (#13564)
* [homekit] add BasicFan accessory

This is Fan v1. It's a subset of FanV2, except that Home allows you
to customize the icon to show a ceiling fan.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-12-09 19:17:51 +01:00
Cody Cutrer
b56ab10e00
[homekit] implement basic command completion (#13878)
just the sub-commands.

since the show command is already a "search", I didn't feel it's super
important to implement on that

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-12-09 08:56:27 +01:00
Cody Cutrer
6a16c889f2
[homekit] persist all known accessories, to prevent loss of homekit information (#13484)
* [homekit] persist all known accessories, to prevent loss of homekit information

See the readme for more details, but basically this keeps track of every
accessory we've ever created, and if it no longer exists, presents a dummy
accessory instead. If the accessory comes back, nothing is lost in the Home
app; if you meant to prune it permanently, you have to run a console command.

there are also several fixes to prevent presenting the device with missing data -
such as when the bundle stops, _don't_ explicitly remove the accessories until
the server has stopped.

we also don't increment the configuration version unless the configuration
has _actually_ changed (so removing and re-adding the exact same thing
won't trigger the device to reconnect). this even works across restarts
of the bundle, because we're persisting all the accessory information
for dummy information anyway.

* [homekit] Address review comments for accessory persistence

* update hap-java to 2.0.4
* remove unused local variable
* [homekit] ensure accessories are replaced in a batch

so that HAP-Java can maintain subscriptions with the new objects

* [homekit] log individual dummy accessories up to 5
* [homekit] Tweak readme for dummy accessories slightly.

 * Be consistent with proper usage of useDummyAccessories.
 * Make the sentence more clear about the effects of having dummy accessories.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-12-08 13:52:30 +01:00
Дилян Палаузов
6c1373f7c2
Typos a/an (#13819) 2022-12-02 13:07:31 +01:00
Cody Cutrer
826fc9e8d7
[homekit] make sure to convert step values to Celsius (#13796)
otherwise if your step is 1.0 in fahrenheit, then your
values will get rounded to 1.0 celsius, and you might not
even notice you've lost precision in the Home app.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-11-28 23:11:40 +01:00
eugen
5c5b3c29c9
[homekit] support stop for blinds (#13788)
* implement new blinds logic
* fix NPE, improve emulated state

Signed-off-by: Eugen <eugen@relotrust.com>
2022-11-27 23:39:50 +01:00