Closed tao2years closed 1 year ago
The linked PR should fix this, looks like you are the first person to try the simulator out, thanks for the report! :-)
❯ miiocli devtools miio-simulator --file miio/integrations/zhimi/fan/zhimi_fan.yaml
INFO Available models: [MiioModel(model='zhimi.fan.sa1', name='unknown name'), MiioModel(model='zhimi.fan.za1', name='unknown name'),
MiioModel(model='zhimi.fan.za3', name='unknown name'), MiioModel(model='zhimi.fan.za4', name='unknown name'), MiioModel(model='zhimi.fan.v3',
name='unknown name'), MiioModel(model='zhimi.fan.v2', name='unknown name')]
WARNING No --model defined, using the first supported one: zhimi.fan.sa1
INFO Miio push server started with address=0.0.0.0 server_id=1718865432
❯ miiocli fan --ip 127.0.0.1 --token 00000000000000000000000000000000 status
Running command status
rw- Power (FanStatus.is_on): True
rw- LED Brightness (FanStatus.led_brightness): LedBrightness.Bright
rw- Buzzer (FanStatus.buzzer): False
rw- Child Lock (FanStatus.child_lock): False
rw- Natural Speed Level (FanStatus.natural_speed): 2
rw- Direct Speed (FanStatus.direct_speed): 1
rw- Oscillate (FanStatus.oscillate): False
r-- AC Powered (FanStatus.ac_power): True
r-- Motor Speed (FanStatus.speed): 277 RPM
rw- Oscillation Angle (FanStatus.angle): 120
Describe the bug When I use the cmd "miiocli devtools miio-simulator --file miio/integrations/zhimi/fan/zhimi_fan.yaml" to create a simulator, it reports the ERROR “AttributeError: 'SimulatedMiio' object has no attribute 'encode' ”
Version information (please complete the following information):
Device information: None
To Reproduce
Expected behavior A simulator created
Console output