-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add HAP doorbell input type * Refactor out SSW into stateless_switch_base so that both doorbell and ssw inherit from the base class Signed-off-by: Timothy Langer <[email protected]>
- Loading branch information
Showing
11 changed files
with
355 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) Shelly-HomeKit Contributors | ||
* All rights reserved | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "shelly_hap_doorbell.hpp" | ||
|
||
#include "HAPUUID.h" | ||
|
||
namespace shelly { | ||
namespace hap { | ||
|
||
const HAPUUID kHAPServiceType_Doorbell = HAPUUIDCreateAppleDefined(0x121); | ||
|
||
Doorbell::Doorbell(int id, Input *in, struct mgos_config_in_ssw *cfg) | ||
: StatelessSwitchBase(id, in, cfg, SHELLY_HAP_IID_BASE_DOORBELL, | ||
&kHAPServiceType_Doorbell, "service.doorbell") { | ||
} | ||
|
||
Doorbell::~Doorbell() { | ||
} | ||
|
||
Component::Type Doorbell::type() const { | ||
return Type::kDoorbell; | ||
} | ||
|
||
} // namespace hap | ||
} // namespace shelly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) Shelly-HomeKit Contributors | ||
* All rights reserved | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
#include "shelly_hap_stateless_switch_base.hpp" | ||
|
||
namespace shelly { | ||
namespace hap { | ||
|
||
class Doorbell : public StatelessSwitchBase { | ||
public: | ||
Doorbell(int id, Input *in, struct mgos_config_in_ssw *cfg); | ||
virtual ~Doorbell(); | ||
|
||
// Component interface impl. | ||
Type type() const override; | ||
}; | ||
|
||
} // namespace hap | ||
} // namespace shelly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.