Comments (6)
I think, the "HomeKit apps" will not be notified generally. The brigde is connected to the HomeKit and send/receive states.
The App connect the HomeKit an send/receive the states to/from the HomeKit. The Homekit mediates only. It seems to me, the second app have no reliable connection to the homekit. Can the second App switch and the first App see the action?
from hap-python.
The effect is the same in Use case #3 even when switching the roles of Device/Homekit App #1 and #2. I can rule out connectivity issues.
from hap-python.
The effect is the same in Use case #3 even when switching the roles of Device/Homekit App #1 and #2. I can rule out connectivity issues.
Question: both clients Device/Homekit App #1 and #2 are on the same iOS release? And if you swipe down on the Device/Homekit (try refresh the view) nothing changed?
I have an equal use case, but using HTTPServer (example: /accessories/Http.py) to get the device state in reverse. If i'm switching manually, the device send {"aid":XXX,"services": {"Switch": {"On": true}}}' or false to the bridge. It works as expected.
from hap-python.
@Pythonaire : Yes, both devices are on same iOS. I observed this behaviour during after multiple test/wipe/test iterations.
The http example hint is unfortunately still not an option, as said in my initial post, the switch does not have the capabilities to send something back.
from hap-python.
@Pythonaire : Yes, both devices are on same iOS. I observed this behaviour during after multiple test/wipe/test iterations.
The http example hint is unfortunately still not an option, as said in my initial post, the switch does not have the capabilities to send something back.
could you try additional notify() in conjunction with get_value()?
from hap-python.
That's my switch, with setter_callback and getter_callback, it works as expected.
class TestSwitch(Accessory):
category = CATEGORY_SWITCH
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.set_info_service(firmware_revision='0.0.3', model='XXX', manufacturer= 'XXX', serial_number="XXX")
switch = self.add_preload_service('Switch', chars=['On'])
self.UnitState = switch.configure_char('On') # bool needed
self.UnitState.set_value(self.getState())
self.UnitState.setter_callback = self.setState
self.UnitState.getter_callback = self.getState()
def getState(self):
try:
state = requests.get(url).json() # return int
except ConnectTimeout as e:
logging.info('**** request to {0} timed out: {1}'.format(url, e))
state = 0
return bool(state)
def setState(self, value): # value is bool
state = int(value)
try:
requests.post(url, data = str(value)) # need str
except ConnectTimeout as e:
state = 0
logging.info('**** request.post got exception {0}'.format(e))
return bool(state)
from hap-python.
Related Issues (20)
- use of `socket.inet_aton` prevents ipv6 initialization
- Is orjson supported on 32-bit Raspberian? HOT 7
- installation hanging HOT 3
- Unresponsive Pairing - WireShark dump shows no connection HOT 1
- How to run multiple accessories in 1 process? HOT 2
- Upgrading version 4.4 to 4.5 or 4.6 on rasperian bullseye (armv7l) HOT 2
- cannot find accessory.state HOT 3
- Device not discoverable in home assistant after unpairing twice
- is where a chance to give a bridge a Name, Model, serial number etc? HOT 1
- Homekit shared home support? HOT 1
- Orjson, requires a 64-bit Python with>3.8.5+and<3.9 HOT 13
- Any chance to support Category.AUDIO_RECEIVER ?
- Dehumidifier simple with WaterLevel HOT 4
- Add Support For Camera 2-way Audio
- Best Approach to Integrate with Existing Pi Django Server HOT 1
- CATEGORY_LIGHTBULB configure_char('Brightness'... ValueError("Characteristic not found" HOT 1
- Support for customer locks? HOT 1
- Since Raspberry Pi OS Upgrade Accessory Resets to Unpaired when Restarted HOT 1
- Stopped working after upgrading to iOS 17 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hap-python.