Skip to content

Commit

Permalink
Fix light model starting with int
Browse files Browse the repository at this point in the history
  • Loading branch information
Neoteknic committed Oct 22, 2024
1 parent a2e9816 commit 26bde74
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion library/Phue/LightModel/LightModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ public static function build(string $modelId): AbstractLightModel
$classNameModel = ucfirst(strtolower($modelId)) . 'Model';

if (! class_exists($classNamePrefix . $classNameModel)) {
$classNameModel = 'UnknownModel';
$modelId='l'.$modelId;
$classNameModel = ucfirst(strtolower($modelId)) . 'Model';
if (! class_exists($classNamePrefix . $classNameModel)) {
$classNameModel = 'UnknownModel';
}
}

$finalClassName = $classNamePrefix . $classNameModel;
Expand Down

0 comments on commit 26bde74

Please sign in to comment.