@riddix/hamh 2.1.0-alpha.383 → 2.1.0-alpha.384

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -171718,14 +171718,27 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
171718
171718
  statusText: `Unsupported mode: ${newMode}`
171719
171719
  };
171720
171720
  }
171721
- if (isRoomMode(newMode) && this.state.config.cleanRoom) {
171722
- homeAssistant.callAction(
171723
- this.state.config.cleanRoom(newMode, this.agent)
171724
- );
171725
- return {
171726
- status: ModeBase3.ModeChangeStatus.Success,
171727
- statusText: "Starting room cleaning"
171728
- };
171721
+ if (isRoomMode(newMode)) {
171722
+ try {
171723
+ const serviceArea = this.agent.get(ServiceAreaBehavior);
171724
+ if (serviceArea.state.selectedAreas?.length > 0) {
171725
+ homeAssistant.callAction(this.state.config.start(void 0, this.agent));
171726
+ return {
171727
+ status: ModeBase3.ModeChangeStatus.Success,
171728
+ statusText: "Starting room cleaning"
171729
+ };
171730
+ }
171731
+ } catch {
171732
+ }
171733
+ if (this.state.config.cleanRoom) {
171734
+ homeAssistant.callAction(
171735
+ this.state.config.cleanRoom(newMode, this.agent)
171736
+ );
171737
+ return {
171738
+ status: ModeBase3.ModeChangeStatus.Success,
171739
+ statusText: "Starting room cleaning"
171740
+ };
171741
+ }
171729
171742
  }
171730
171743
  switch (newMode) {
171731
171744
  case 1 /* Cleaning */: