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

New oven #62

Merged
merged 3 commits into from
May 29, 2024
Merged

New oven #62

merged 3 commits into from
May 29, 2024

Conversation

adrianlasota
Copy link
Contributor

@adrianlasota adrianlasota commented May 24, 2024

@abmantis Added support for new oven: W7I HT58 T

{'..., 'lastModified': 1716578321632, 'attributes': {'XCat_ApplianceInfoSetSerialNumber': {'value': '142403006974', 'updateTime': 1716547460514}, 'OvenUpperCavity_CycleSetDonenessAdjust': {'value': '0', 'updateTime': 1716547460514}, 'OvenUpperCavity_DisplaySetLightOn': {'value': '0', 'updateTime': 1716547460514}, 'OvenUpperCavity_CycleSetPreheatOn': {'value': '0', 'updateTime': 1716547460514}

------------------------------ MENU ------------------------------
u. Update status from server
l. Control lock toggle
L. Light toggle
b. Set display brightness
t. Set cooking mode/temp
o. Stop/cancel cooking
k. Set kitchen timer
s. Toggle Sabbath mode
p. Print status
v. Print raw status
c. Custom command
q. Exit
-------------------------------------------------------------------
Enter your choice: L
2024-05-24 21:33:43,308 [whirlpool.appliance INFO]: Sending attributes: {'OvenUpperCavity_DisplaySetLightOn': '1'}
2024-05-24 21:33:43,982 [whirlpool.appliance DEBUG]: Reply: {"transaction_id":"6672","message":"Command executed successfully","status":"00"}


------------------------------ MENU ------------------------------
u. Update status from server
l. Control lock toggle
L. Light toggle
b. Set display brightness
t. Set cooking mode/temp
o. Stop/cancel cooking
k. Set kitchen timer
s. Toggle Sabbath mode
p. Print status
v. Print raw status
c. Custom command
q. Exit
-------------------------------------------------------------------
Enter your choice: Attributes updated
2024-05-24 21:33:49,947 [whirlpool.appliance DEBUG]: Updating attribute XCat_WifiSetDisableWifiCommModule with 0 (1716579230293)
2024-05-24 21:33:49,947 [whirlpool.appliance DEBUG]: Updating attribute OvenUpperCavity_DisplaySetLightOn with 0 (1716579230293)
Attributes updated
u
2024-05-24 21:34:02,957 [whirlpool.oven ERROR]: Unknown cavity state: None
Attributes updated
online: True
display brightness (%): 90
control lock: False
kitchen timer 1 state: KitchenTimerState.Standby
upper meat probe: False
upper light: False
upper door open: False
upper temp (current/target, in C): 0.0/0.0
upper state: CavityState.Standby
upper cook mode: CookMode.Standby
upper cook time (seconds): 0


------------------------------ MENU ------------------------------
u. Update status from server
l. Control lock toggle
L. Light toggle
b. Set display brightness
t. Set cooking mode/temp
o. Stop/cancel cooking
k. Set kitchen timer
s. Toggle Sabbath mode
p. Print status
v. Print raw status
c. Custom command
q. Exit
-------------------------------------------------------------------
Enter your choice: b
Brightness (0-100): 50
2024-05-24 21:34:17,328 [whirlpool.appliance INFO]: Sending attributes: {'Sys_DisplaySetBrightnessPercent': '50'}
2024-05-24 21:34:17,765 [whirlpool.appliance DEBUG]: Reply: {"transaction_id":"6219","message":"Command executed successfully","status":"00"}


------------------------------ MENU ------------------------------
u. Update status from server
l. Control lock toggle
L. Light toggle
b. Set display brightness
t. Set cooking mode/temp
o. Stop/cancel cooking
k. Set kitchen timer
s. Toggle Sabbath mode
p. Print status
v. Print raw status
c. Custom command
q. Exit
-------------------------------------------------------------------
Enter your choice: Attributes updated
2024-05-24 21:34:18,578 [whirlpool.appliance DEBUG]: Updating attribute Sys_DisplaySetBrightnessPercent with 50 (1716579258850)

}
auth = Auth(BACKEND_SELECTOR_MOCK, "email", "secretpass", http_client_mock.session)
am = AppliancesManager(BACKEND_SELECTOR_MOCK, auth, http_client_mock.session)
am._add_appliance(appliance)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to avoid using internal class methods in the tests.
Can we switch this to use only external stuff (in this case probably http_client_mock and am.fetch_appliances()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll do that, but I focused on unit testing this specific method only ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just extended actual unittest about oven

async def test_add_appliance(data_model_key, http_client_mock: AiohttpClientMocker):
appliance = {
"DATA_MODEL_KEY": f"{data_model_key}",
"CATEGORY_NAME": "Cooking",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this data to the data/owned_appliances.json file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Added new data model entry for oven

Signed-off-by: Adrian Lasota <[email protected]>
Signed-off-by: Adrian Lasota <[email protected]>
@adrianlasota
Copy link
Contributor Author

@abmantis could you review?

@abmantis abmantis merged commit 79fda82 into abmantis:master May 29, 2024
4 checks passed
@abmantis
Copy link
Owner

Thanks!

@adrianlasota
Copy link
Contributor Author

@abmantis could we release this change? I'm going to add support in HA core

@abmantis
Copy link
Owner

abmantis commented Jun 9, 2024

@adrianlasota I've just released v0.18.9 that includes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants