Saved the new state received from TellStick Duo

This commit is contained in:
Micke Prag 2009-02-09 11:25:44 +00:00
parent ca42ff2852
commit ccd80c5e70
2 changed files with 8 additions and 5 deletions

View file

@ -148,7 +148,10 @@ bool Manager::setModel(int intDeviceId, int intModel) {
}
bool Manager::setDeviceState( int intDeviceId, int intDeviceState, const std::string &strDeviceStateValue ) {
return settings.setDeviceState(intDeviceId, intDeviceState, strDeviceStateValue);
if (intDeviceState != TELLSTICK_BELL) {
return settings.setDeviceState(intDeviceId, intDeviceState, strDeviceStateValue);
}
return true;
}
int Manager::getDeviceState( int intDeviceId ) const {
@ -207,6 +210,8 @@ void Manager::parseMessage( const std::string &message ) {
}
}
if (found) {
//First save the last sent command
setDeviceState(it->first, method, "");
for(CallbackList::const_iterator callback_it = callbacks.begin(); callback_it != callbacks.end(); ++callback_it) {
(*callback_it).event(it->first, method, message.c_str(), (*callback_it).id, (*callback_it).context);
}