Comments (2)
ohh, I forgot the '' quotes.
from pyscript.
import pprint
@time_trigger
def tryouts(trigger_type=None, var_name=None, value=None, old_value=None, context=None, **kwargs):
ent = hass.states.get('climate.ac_office')
log.debug(ent)
attrs = ent.attributes
log.debug(pprint.pformat(attrs))
(or just state.getattr('climate.ac_office')
)
resulted in
2023-09-06 12:48:48.337 DEBUG (MainThread) [custom_components.pyscript.file.tryouts.tryouts] <state climate.ac_office=fan_only; hvac_modes=[<HVACMode.FAN_ONLY: 'fan_only'>, <HVACMode.DRY: 'dry'>, <HVACMode.COOL: 'cool'>, <HVACMode.HEAT: 'heat'>, <HVACMode.HEAT_COOL: 'heat_cool'>, <HVACMode.OFF: 'off'>], min_temp=7, max_temp=35, target_temp_step=1, fan_modes=['Auto', 'Silence', '1', '2', '3', '4', '5'], preset_modes=['none', 'away', 'eco', 'boost'], swing_modes=['Off', 'Vertical', 'Horizontal', '3D'], current_temperature=25.0, temperature=None, fan_mode=Silence, preset_mode=none, swing_mode=Horizontal, friendly_name=OfficeAC, supported_features=57 @ 2023-09-06T12:43:57.009294+03:00>
2023-09-06 12:48:48.337 DEBUG (MainThread) [custom_components.pyscript.file.tryouts.tryouts] {'current_temperature': 25.0,
'fan_mode': 'Silence',
'fan_modes': ['Auto', 'Silence', '1', '2', '3', '4', '5'],
'friendly_name': 'OfficeAC',
'hvac_modes': [,
,
,
,
,
],
'max_temp': 35,
'min_temp': 7,
'preset_mode': 'none',
'preset_modes': ['none', 'away', 'eco', 'boost'],
'supported_features': ,
'swing_mode': 'Horizontal',
'swing_modes': ['Off', 'Vertical', 'Horizontal', '3D'],
'target_temp_step': 1,
'temperature': None}
climate.smart_kantoor_vloerverwarming
is an entity State instance
'climate.smart_kantoor_vloerverwarming'
is the entity ID
state.getattr()
accepts only entity IDs
from pyscript.
Related Issues (20)
- 2023.12 Beta - state.set not setting state HOT 1
- [Feature Request] Error/warning when function name is duplicated in code
- Even with supports_response, service is not returning anything HOT 2
- not implemented ast ast_generatorexp HOT 1
- can not import library after reboot of HA
- Expose home assistant jinja template functions HOT 1
- Croniter version conflict HOT 1
- "MQTT entity name starts with the device name in your config"
- Feature Request: Make apps configurable from Home assistant UI
- Feature Request: exclude from recorder
- attribute changes not detected
- "async with" statement fails without target variable assignment
- Newbie help running Python script under pyscript as a service HOT 2
- Translated state HOT 1
- Template evaluation HOT 2
- Exception in <file.pv_excess_control.on_time> line 246 HOT 2
- Issues using yaml module in pyscript HOT 2
- Python 3.11 support removed from Home Assistant HOT 4
- помогите с IMPORT в home asistant HOT 1
- PyRight LSP HOT 9
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 pyscript.